﻿using System.Configuration;

namespace SvnDeploy.Service.Cfg
{
    public class SvnDeployConfigurationSection : ConfigurationSection
    {
        [ConfigurationProperty("applications", IsDefaultCollection = false)]
        public ApplicationCollection Applications
        {
            get { return (ApplicationCollection)base["applications"]; }
        }

        [ConfigurationProperty("authentication")]
        public AuthenticationElement Authentication
        {
            get { return (AuthenticationElement)base["authentication"]; }
        }

        [ConfigurationProperty("backupSettings")]
        public BackupSettingsElement BackupSettings
        {
            get { return (BackupSettingsElement)base["backupSettings"]; }
        }

        [ConfigurationProperty("interval", DefaultValue = 600)]
        public int Interval
        {
            get { return (int)base["interval"]; }
        }

        [ConfigurationProperty("wait", DefaultValue = 5)]
        public int Wait
        {
            get { return (int)base["wait"]; }
        }

        public static SvnDeployConfigurationSection GetConfiguration()
        {
            return ConfigurationManager.GetSection("svnDeploy") as SvnDeployConfigurationSection;
        }
    }
}
